import service from '@/utils/request.js'
// 将所有的针对coach的请求，都封装到一个对象中
const coachApi = {
    list(coachQuery) {
        return service.get('/coach/list', {params: coachQuery})
    },
    selectAll() {
        return service.get('/coach/selectAll')
    },
    deleteById(id) {
        return service.delete( `/coach/deleteById/${id}`)
    },
    deleteAll(ids) {
        return service.delete( `/coach/deleteAll/${ids}`)
    },
    add(coach) {
        //coach以JSON形式传递到后台，后端使用@RequestBody接收
        return service.post('/coach/add', coach)
    },
    selectById(id) {
        return service.get(`/coach/selectById/${id}`)
    },
    update(coach) {
        return service.put('/coach/update', coach)
    },
    updateStatus(id, status) {
        return service.put(`/coach/updateStatus/${id}/${status}`)
    }
}

export default coachApi